<?php
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
/**
 * Product list template
 *
 * @see Mage_Catalog_Block_Product_List
 */
?>
<script type="text/javascript" src="<?php echo $this->getSkinUrl('js/jquery.jcarousel.min.js');?>"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#carousel').jcarousel({
		scroll:1
		//auto:2
    });
});
</script>

<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>

<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php $_columnCount = 100 //$this->getColumnCount(); ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php if ($i++%$_columnCount==0): ?>
<div class="carousel">
<div class="row">
<ul id="carousel">
  <?php endif ?>
  <li class="item<?php if(($i-1)%$_columnCount==0): ?> first<?php elseif($i%$_columnCount==0): ?> last<?php endif; ?>">
    <div class="products-box">
      <?php if( Mage::getModel('newproduct/grid')->isNewProduct($_product->getId()) ): ?>
      <div class="products-new">&nbsp;</div>
      <?php endif; ?>
      <?php if( Mage::getModel('featuredproduct/grid')->isFeaturedProduct($_product->getId()) ): ?>
      <div class="featured-product">&nbsp;</div>
	  <?php endif; ?>
      <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(160,160); ?>" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /> </a>
      <div class="shadow-s">&nbsp;</div>
      <div class="pro-info">
        <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
        <?php /*?><div class="desc std"><?php if ($_product->getData('short_description')): ?>
				<?php echo substr($_product->getResource()->getAttribute('short_description')->getFrontend()->getValue($_product),0,88), '...' ?><?php endif ?> </div><?php */?>
      </div>
      <?php echo $this->getPriceHtml($_product, true) ?>
      <div class="clear"></div>
        </div>
  </li>
  <?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?>
</ul>
</div></div>
<?php endif ?>
<?php endforeach ?>
<script type="text/javascript">decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])</script>
<?php endif; ?>